﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ViolatedRecordForm.aspx.cs"
    Inherits="YhmOA.Integrated.Car.ViolatedRecordForm" %>

<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.1, Version=10.1.6.0, Culture=neutral, PublicKeyToken=c6bed6029ccaee5e"
    Namespace="DevExpress.Web.ASPxLoadingPanel" TagPrefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link type="text/css" rel="Stylesheet" href="../../Styles/Common.css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.5.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/include.jquery.js"></script>
    <script type="text/javascript" src="../../Scripts/Common.js"></script>
    <script src="../../Scripts/DevEx.js" type="text/javascript"></script>
    <script type="text/javascript">
        function OnViolatedCode(s, e) {//
            if (txt_ViolatedCodeCtrl.GetSelectedIndex() > -1) {
                var valueArr = txt_ViolatedCodeCtrl.GetValue().split("█");
                txt_ViolatedSContentCtrl.SetText(valueArr[0]);
                txt_ViolatedContentCtrl.SetText(valueArr[1]);
                txt_PenalizeMoneyCtrl.SetText(valueArr[2]);
            } else {
                txt_ViolatedSContentCtrl.SetText('');
                txt_ViolatedContentCtrl.SetText('');
                txt_PenalizeMoneyCtrl.SetText('');
            }
        };
        function Save(s, e) {
            if (ASPxClientEdit.ValidateEditorsInContainer(null)) {
                if (GetQS("mode") == "1") {
                    ConfirmDialog('提示信息', '是否要自动生成一条费用记录?', 250, 180,
                    function () {
                        cbSaveCtrl.PerformCallback('true');
                        lpSaveCtrl.Show();
                        $(this).wijdialog('close');
                    },
                    function () {
                        cbSaveCtrl.PerformCallback('false');
                        lpSaveCtrl.Show();
                        $(this).wijdialog('close');
                    });
                } else {
                    cbSaveCtrl.PerformCallback('true');
                    lpSaveCtrl.Show();
                    $(this).wijdialog('close');
                }
            }
        };
        function SaveCallback(s, e) {
            if (s.cpIsSucceed == true) {
                lpSaveCtrl.SetText('提交成功');
                parent.Search();
                window.setTimeout(function () { lpSaveCtrl.Hide(); lpSaveCtrl.SetText('正在提交信息,请稍后...'); }, 1500);
            } else {
                lpSaveCtrl.SetText('提交失败');
                window.setTimeout(function () { lpSaveCtrl.Hide(); lpSaveCtrl.SetText('正在提交信息,请稍后...'); }, 1500);
            }
        };
        //重置文本框
        function ResetEdit(s, e) {
            ASPxClientEdit.ClearEditorsInContainer(null);
            txt_DriverCtrl.Focus();
            txt_ViolatedCodeCtrl.Focus();
            txt_PenalizeDepartCtrl.Focus();
            txt_PlateNumCtrl.Focus();
            lpSaveCtrl.SetText('正在提交信息,请稍后...');
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="MainRound">
        <div class="MainRoundContent">
            <div class="MainRoundContentW">
                <div class="MainBody">
                    <table class="Table" style="width: 740px">
                        <tr>
                            <td style="width: 120px">
                                车牌号码：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxComboBox ID="txt_PlateNum" runat="server" Width="200px" TabIndex="1" ClientInstanceName="txt_PlateNumCtrl"
                                    Spacing="0" DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith" ClientIDMode="AutoID"
                                    ValueType="System.String">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus"/>
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入车牌号码"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请输入车牌号码">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                            <td style="width: 120px">
                                驾驶员：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxComboBox ID="txt_Driver" runat="server" Width="200px" TabIndex="2" ClientInstanceName="txt_DriverCtrl"
                                    Spacing="0" DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith" ClientIDMode="AutoID"
                                    ValueType="System.String">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus" />
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入驾驶员"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请输入驾驶员">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                违章时间：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxDateEdit ID="txt_ViolatedTime" ClientInstanceName="txt_ViolatedTimeCtrl" runat="server"
                                    TabIndex="3" NullText="请选择违章时间" Width="200px" Spacing="0" EditFormat="DateTime"
                                    PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择违章时间"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                            <td style="width: 120px">
                                违章代码：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxComboBox ID="txt_ViolatedCode" runat="server" Width="200px" TabIndex="4" ClientInstanceName="txt_ViolatedCodeCtrl"
                                    Spacing="0" DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith" ClientIDMode="AutoID"
                                    ValueType="System.String" DropDownRows="5" TextFormatString="{0}" ValueField="Value1">
                                    <Columns>
                                        <dx:ListBoxColumn FieldName="Key" Caption="违章代码" />
                                        <dx:ListBoxColumn FieldName="Value" Caption="违章内容简写" />
                                        <dx:ListBoxColumn FieldName="Value1" Width="0px" Visible="false"/>
                                    </Columns>
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus"
                                        TextChanged="OnViolatedCode" />
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入违章代码"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请输入违章代码">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                违章内容简写：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_ViolatedSContent" ClientInstanceName="txt_ViolatedSContentCtrl"
                                    runat="server" MaxLength="500" NullText="请输入违章简写" TabIndex="5" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入违章内容简写"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                违章内容：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_ViolatedContent" ClientInstanceName="txt_ViolatedContentCtrl"
                                    runat="server" MaxLength="500" NullText="请输入违章内容" TabIndex="6" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入违章内容"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                违章地点：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_ViolatedAddress" ClientInstanceName="txt_ViolatedAddressCtrl"
                                    runat="server" MaxLength="50" NullText="请输入违章地点" TabIndex="7" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入违章地点"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                处罚部门：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxComboBox ID="txt_PenalizeDepart" runat="server" Width="200px" TabIndex="8" ClientInstanceName="txt_PenalizeDepartCtrl"
                                    Spacing="0" DropDownStyle="DropDown" IncrementalFilteringMode="StartsWith" ClientIDMode="AutoID"
                                    ValueType="System.String">
                                    <ClientSideEvents Init="DevExObj.OnInit" LostFocus="DevExObj.OnLostFocus" GotFocus="DevExObj.OnGotFocus"/>
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入处罚部门"
                                        ErrorFrameStyle-CssClass="TableNoBorder" ErrorText="请输入处罚部门">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                </dx:ASPxComboBox>
                            </td>

                        </tr>
                        <tr>
                            <td style="width: 120px">
                                处罚时间：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxDateEdit ID="txt_PenalizeTime" ClientInstanceName="txt_PenalizeTimeCtrl" runat="server"
                                    TabIndex="9" NullText="请选择处罚时间" Width="200px" Spacing="0" EditFormat="DateTime"
                                    PopupVerticalAlign="TopSides">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请选择处罚时间"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxDateEdit>
                            </td>
                            <td style="width: 120px">
                                处罚金额：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_PenalizeMoney" ClientInstanceName="txt_PenalizeMoneyCtrl"
                                    runat="server" MaxLength="18" NullText="请输入处罚金额" TabIndex="10" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入处罚金额"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                        <RegularExpression ErrorText="只能输入非负数字" ValidationExpression="^\d+(\.\d+)?$" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                处罚决定书编号：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_CFJDSSN" ClientInstanceName="txt_CFJDSSNCtrl" runat="server"
                                    MaxLength="50" NullText="请输入处罚决定书编号" TabIndex="11" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入处罚决定书编号"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                缴费票据编号：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_PaySN" ClientInstanceName="txt_PaySNCtrl" runat="server" MaxLength="50"
                                    NullText="请输入缴费票据编号" TabIndex="12" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入缴费票据编号"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                缴费地点：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_PayAddress" ClientInstanceName="txt_PayAddressCtrl" runat="server"
                                    MaxLength="50" NullText="请输入缴费地点" TabIndex="13" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入缴费地点"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                经办人：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_Operator" ClientInstanceName="txt_OperatorCtrl" runat="server"
                                    MaxLength="50" NullText="请输入经办人" TabIndex="14" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入经办人"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                        <RequiredField IsRequired="True" />
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 120px">
                                内部处理：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_InternalDispose" ClientInstanceName="txt_InternalDisposeCtrl"
                                    runat="server" MaxLength="500" NullText="请输入内部处理" TabIndex="15" Width="200px">
                                    <ValidationSettings ErrorDisplayMode="ImageWithTooltip" RequiredField-ErrorText="请输入内部处理"
                                        ErrorFrameStyle-CssClass="TableNoBorder">
                                    </ValidationSettings>
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                            <td style="width: 120px">
                                备注：
                            </td>
                            <td style="width: 250px">
                                <dx:ASPxTextBox ID="txt_Remarks" ClientInstanceName="txt_RemarksCtrl" runat="server"
                                    MaxLength="250" NullText="请输入备注" TabIndex="16" Width="200px">
                                    <NullTextStyle ForeColor="LightSteelBlue" />
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <table class="TableNoBorder" style="width: 740px">
                        <tr>
                            <td colspan="2" />
                            <td align="left" style="margin-right: 20px; width: 100px">
                                <dx:ASPxButton ID="btnSave" runat="server" Text="保  存" Width="80px" AutoPostBack="false"
                                    TabIndex="17">
                                    <ClientSideEvents Click="Save" />
                                </dx:ASPxButton>
                            </td>
                            <td align="left" style="margin-right: 20px; width: 100px">
                                <dx:ASPxButton ID="btnCancel" runat="server" Text="重  置" Width="80px" AutoPostBack="false"
                                    TabIndex="18" CausesValidation="False">
                                    <ClientSideEvents Click="ResetEdit" />
                                </dx:ASPxButton>
                            </td>
                        </tr>
                    </table>
                    <dx:ASPxCallback ID="cbSave" runat="server" ClientInstanceName="cbSaveCtrl" OnCallback="cbSave_Callback">
                        <ClientSideEvents CallbackComplete="SaveCallback" />
                    </dx:ASPxCallback>
                    <dx:ASPxLoadingPanel ID="lpSave" runat="server" Text="正在提交信息,请稍后..." ClientInstanceName="lpSaveCtrl">
                    </dx:ASPxLoadingPanel>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
